package com.unit.testng.groups;

import org.testng.annotations.AfterGroups;
import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test;

/**
 * @author bigFish
 * @Title: 以方法分组
 */
public class GroupsByMethod {
    @Test(groups = "server")
    public void server1(){
        System.out.println("服务端测试11111");
    }

    @Test(groups = "server")
    public void server2(){
        System.out.println("服务端测试22222");
    }
    @Test(groups = "server")
    public void server3(){
        System.out.println("服务端测试3");
    }

    @Test(groups = "client")
    public void client1(){
        System.out.println("客户端测试1");
    }

    @Test(groups = "client")
    public void client2(){
        System.out.println("客户端测试2");
    }



    @AfterGroups("server")
    public void afterGroupsOnServer(){
        System.out.println("在服务端测试方法运行后执行");
    }

    @BeforeGroups("client")
    public void beForGroupOnClient(){
        System.out.println("在客户端测试方法运行前执行");
    }

    @AfterGroups("client")
    public void afterGroupsOnClient(){
        System.out.println("在客户端测试方法运行后执行");
    }

    @BeforeGroups("server")
    public void beForGroupOnServer(){
        System.out.println("在服务端测试方法运行前执行");
    }
}
